package com.juli.v2xdemo.animator;

import android.animation.ObjectAnimator;
import android.view.View;

/**
 * Created by Administrator on 2019/9/29 0029.
 */

public class AnimaTools {

    /**
     * 旋转角度
     */
    public static ObjectAnimator viewRotation(View view , float start, float end, int time) {
        ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(view, "rotation", start, end);
        objectAnimator1.setDuration(time).start();
        return objectAnimator1;
    }

    /**
     * Y轴 从上到下 平移
     * @param view
     * @param start
     * @param finish
     * @param time
     * @return
     */

    public static ObjectAnimator top2bottomTranslationY(View view,float start,float finish,int time) {

        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationY", start, finish);

        objectAnimator.setDuration(time);
        objectAnimator.start();
        return objectAnimator;
    }

}
